//
//  ZFK_postCollectionViewCell.m
//  Drops
//
//  Created by SHG on 16/5/25.
//  Copyright © 2016年 Drops.er. All rights reserved.
//

#import "ZFK_postCollectionViewCell.h"
#import "ZFK_post.h"
#import "UIKit+AFNetworking.h"

@implementation ZFK_postCollectionViewCell

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    
    self.imageView = [[UIImageView alloc] initWithFrame:self.contentView.frame];
    self.imageView.backgroundColor = [UIColor colorWithRed:arc4random() % 256 / 255.0 green:arc4random() % 256 / 255.0 blue:arc4random() % 256 / 255.0 alpha:1];
    [self.contentView addSubview:self.imageView];
    
//    self.userImage = [[UIImageView alloc] initWithFrame:CGRectMake(5, self.imageView.frame.size.height / 5 * 3.5, 50, 50)];
//    self.userImage.layer.cornerRadius = 25;
//    self.userImage.layer.masksToBounds = YES;
//    self.userImage.backgroundColor = [UIColor lightGrayColor];
//    [self.imageView addSubview:self.userImage];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.imageView.frame = self.contentView.frame;
//    self.userImage.frame = CGRectMake(5, self.imageView.frame.size.height / 5 * 3.5, 50, 50);
//    NSLog(@"/*******/%f", self.contentView.frame.size.height);
}

- (void)setPost:(ZFK_post *)post {
        _post = post;

    [self.imageView setImageWithURL:[NSURL URLWithString:post.postImg]];
//    NSLog(@"postImg:%@", post.postImg);
//    [self.userImage setImageWithURL:[NSURL URLWithString:post.uAvatar]];
}

@end
